﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CloudSoft.Extensions;

namespace ERPStore.Exporter.Models.LeadSources
{
	public class NetAffiliationSource : ERPStore.Models.LeadSourceBase
	{
		public override string Id
		{
			get { return "F814535B-08A1-4CF6-BB2E-0C6177F6D16D"; }
		}

		public override string Name
		{
			get { return "NetAffiliation"; }
		}

		public override string Description
		{
			get { return "Net Affiliation"; }
		}

		public override string TrackSourceId
		{
			get { return "netaff"; }
		}

		public override string Medium
		{
			get { return "aff"; }
		}

		public override ERPStore.Models.LeadSourceType LeadSourceType
		{
			get { return ERPStore.Models.LeadSourceType.Affiliation; }
		}

		public override bool Match(Uri sourceUri, Uri landingUri, out string keywords, out string subHost, out decimal amount)
		{
			keywords = null; // sourceUri.GetSearchKeywords();
			subHost = null;
			amount = 0.0m;
			var landingPrms = landingUri.GetParameters();
			if (landingPrms.AllKeys.Contains("estid"))
			{
				var estid = landingPrms["estid"];
				if (estid.Equals(TrackSourceId, StringComparison.InvariantCultureIgnoreCase))
				{
					subHost = "NoSubHost";
					return true;
				}
			}

			return false;
		}

	}
}
